/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package myUtils;

import service.ActivityService;

/**
 *
 * @author HX
 */
public class ConsiderateActivityScoreStrategy implements IActivityScoreStrategy{
    private ActivityService activityService;
    public int score(int activiyId, int userId, char degree){
        int score;
        switch(degree){
            case 'A':
                score = 10;
                break;
            case 'B':
                score = 9;
                break;
            case 'C':
                score = 8;
                break;
            case 'D':
                score = 7;
                break;
            case 'E':
                score = 6;
                break;
            default:
                score = 0;
        }
        activityService.editActivityScore(activiyId, userId, score);
        return score;
    }

    public ActivityService getActivityService() {
        return activityService;
    }

    public void setActivityService(ActivityService activityService) {
        this.activityService = activityService;
    }
}
